package com.haixiaoke.saas.bill.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.haixiaoke.saas.common.annotation.Excel;
import com.haixiaoke.saas.common.core.domain.BaseEntity;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


/**
 * 入住账单对象 biz_house_bill
 *
 * @author qixi
 * @date 2024-05-30
 */
@Data
public class HouseBill extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    private String billId;

    /**
     * 关联订单id
     */
    @Excel(name = "关联订单id")
    @NotNull(message = "订单id不能为空")
    private String orderId;

    /**
     * 关联合同id
     */
    @Excel(name = "关联合同id")
    private String lesseeContractId;

    /**
     * 房屋id
     */
    @Excel(name = "房屋id")
    @NotNull(message = "房屋id不能为空")
    private String houseId;

    /**
     * 租户id
     */
    @Excel(name = "租户id")
    private String tenantId;

    /**
     * 部门id
     */
    @Excel(name = "部门id")
    private Long deptId;

    /**
     * 业主id
     */
    @Excel(name = "业主id")
    private Long proprietorId;

    /**
     * 业主名称
     */
    @Excel(name = "业主名称")
    private String proprietorName;

    /**
     * 支付状态: 1,待付款 2,已结清 3,已逾期 4注销
     */
    @Excel(name = "支付状态: 1,待付款 2,已结清 3,已逾期 4注销")
    private String payState;

    /**
     * 账单金额
     */
    @Excel(name = "账单金额")
    private BigDecimal cost;

    /**
     * 最晚付款日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Excel(name = "最晚付款日期", width = 30, dateFormat = "yyyy-MM-dd")
    @NotNull(message = "最晚付款日期不能为空")
    private Date latestPayTime;

    /**
     * 支付时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date payTime;

    /**
     * 支付方式: 1线上 2线下
     */
    @Excel(name = "支付方式: 1线上 2线下")
    private String payMethod;

    /**
     * 支付凭证
     */
    @Excel(name = "支付凭证")
    private String payVoucher;

    /**
     * 账单类型: 1押金账单 2费用账单
     */
    @Excel(name = "账单类型: 1押金账单 2费用账单")
    private String billType;

    /**
     * 违约金生成状态:
     */
    @Excel(name = "违约金生成状态:")
    @NotNull(message = "违约金生成状态不能为空")
    private String penaltyStates;

    /**
     * 违约金比例
     */
    @Excel(name = "违约金比例")
    private BigDecimal penaltyScale;

    /**
     * 账单生成时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @Excel(name = "账单生成时间", width = 30, dateFormat = "yyyy-MM-dd")
    @NotNull(message = "账单生成时间不能为空")
    private Date billCreateTime;

    /**
     * 用户id
     */
    @Excel(name = "用户id")
    private Long userId;

    /**
     * 用户名
     */
    @Excel(name = "用户名")
    private String userName;

    /**
     * 账单启用状态:
     */
    @Excel(name = "账单启用状态:")
    private String billEnableStates;

    /**
     * 账单生效状态:
     */
    @Excel(name = "账单生效状态:")
    private String billEffectiveStates;

    /**
     * 支付用户ID
     */
    @Excel(name = "支付用户ID")
    private Long payUserId;

    /**
     * 支付用户名
     */
    @Excel(name = "支付用户名")
    private String payUserName;

    /**
     * 账单开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Excel(name = "账单开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    @NotNull(message = "账单开始时间不能为空")
    private Date billStartTime;

    /**
     * 账单结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Excel(name = "账单结束时间", width = 30, dateFormat = "yyyy-MM-dd")
    @NotNull(message = "账单结束时间不能为空")
    private Date billEndTime;

    /**
     * 操作人id
     */
    @Excel(name = "操作人id")
    private Long operatorId;


    /**
     * 费用列表
     */
    List<HouseBillItemMerge> houseBillItemMerges;


    /**
     * 违约金
     */
    private BigDecimal penalty;


    /**
     * 费用/押金
     */
    private BigDecimal otherCost;


    /**
     * 房屋地址
     */
    private String premisesAddress;

    /**
     * 账单周期
     */
    private int periods;
}
